﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;
namespace OtherDevice
{
    [Description("称重")]
    public partial class Form_称重 : Form_ControlBase
    {
        public Form_称重()
        {
            InitializeComponent();
        }
        Balance_Base balanceControl;
        public override void FlushToDlg(object devicebase)
        {
            try
            {
                if (devicebase == null)
                    return;
                this.balanceControl = devicebase as Balance_Base;
                this.Dock = DockStyle.Fill;
                this.Show();
            }
            catch (Exception)
            {

            }

        }        
       
        private void btn_BalanceValue_Click_1(object sender, EventArgs e)
        {
            double hight = 0;

            balanceControl.Get(1,100,ref hight);

            txt_Result.Text = $" {hight} g";

        }

        private void btn_Reset_Click(object sender, EventArgs e)
        {
            balanceControl.SetZore();

        }
    }
}
